<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <title>复杂的 Flex 布局示例</title>
    <style>
        body {
            font-family: "楷体", "KaiTi";
            margin: 0;
            padding: 0;
            display: flex;
            flex-direction: column;
            min-height: 100vh;
        }
        header {
            background-color: #f8f8f8;
            padding: 10px;
            width: 100%;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }
        .container {
            display: flex;
            flex: 1;
            flex-direction: row;
        }
        .sidebar {
            width: 20%;
            background-color: #f0f0f0;
            padding: 10px;
            box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
        }
        .content {
            flex: 1;
            display: flex;
            flex-direction: column;
            padding: 10px;
        }
        .content-header {
            background-color: #e0e0e0;
            padding: 10px;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }
        .main-content {
            flex: 1;
            display: flex;
            flex-direction: row;
            padding: 10px;
        }
        .main-content .left {
            flex: 1;
            background-color: #d0d0d0;
            margin-right: 10px;
            padding: 10px;
        }
        .main-content .right {
            flex: 2;
            background-color: #c0c0c0;
            padding: 10px;
        }
        footer {
            background-color: #f8f8f8;
            padding: 10px;
            width: 100%;
            box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
            text-align: center;
        }
    </style>
</head>
<body>

<header>
    <h1>复杂的 Flex 布局示例</h1>
</header>

<div class="container">
    <nav class="sidebar">
        <ul>
            <li><a href="#">导航 1</a></li>
            <li><a href="#">导航 2</a></li>
            <li><a href="#">导航 3</a></li>
            <li><a href="#">导航 4</a></li>
        </ul>
    </nav>

    <div class="content">
        <div class="content-header">
            <h2>内容头部</h2>
        </div>
        <div class="main-content">
            <div class="left">
                <p>左侧内容</p>
            </div>
            <div class="right">
                <p>右侧内容</p>
            </div>
        </div>
    </div>
</div>

<footer>
    <p>页脚内容</p>
</footer>

</body>
</html>
